<template>
  <div>
    <!-- 面包屑 -->
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item><a href="/">活动管理</a></el-breadcrumb-item>
      <el-breadcrumb-item>活动列表</el-breadcrumb-item>
      <el-breadcrumb-item>活动详情</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 表格 -->
    <el-table :data="tableData" stripe style="width: 100%">
      <el-table-column type="index" label="#"> </el-table-column>
      <el-table-column prop="authName" label="权限姓名"> </el-table-column>
      <el-table-column prop="path" label="路径"> </el-table-column>
      <el-table-column prop="address" label="权限等级">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.level == 0">一级权限</el-tag>
          <el-tag v-if="scope.row.level == 1" type="success">二级权限</el-tag>
          <el-tag v-if="scope.row.level == 2" type="warning">三级权限</el-tag>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [],
    };
  },
  methods: {
    //封装的请求
    getser() {
      this.$http.get("rights/list").then((res) => {
        console.log(res);
        this.tableData = res.data;
      });
    },
  },
  mounted() {
    //调用
    this.getser();
  },
};
</script>

<style lang="scss">
.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 0px;
}
</style>
